{% load blog_tags comment_tags %}
<div class="aside">
  <h4 class="title">网站公告</h4>
  <div class="notice">
    <ul>
      {% for notice in notices %}
        <li>
          <time>{{ notice.created_time }}</time>
          <span>{{ notice.text }}</span>
        <li>
      {% empty %}
        暂无通知
      {% endfor %}
    </ul>
  </div>
</div>
<div class="aside">
  <h4 class="title">热门文章排行</h4>
  <ol class="hot-list">
    {% get_hot_article as hot_article_list %}
    {% for article in hot_article_list %}
      <li class="">
        <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">
          {{ article.title }}
        </a>
      </li>
    {% endfor %}
  </ol>
</div>
<div class="aside">
  <h4 class="title">最近发表</h4>
  <ul class="recent-list">
    {% get_recent_article as article_list %}
    {% for article in article_list %}
      <li class="item">
        <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">
          <div class="time">
            <span class="day">{{ article.created_time|date:"d" }}</span> /
            <span class="monty">{{ article.created_time|date:"m" }}</span>
          </div>
          <p>{{ article.title }}</p>
        </a>
      </li>

    {% endfor %}
  </ul>
</div>
<div class="aside">
  <h4 class="title">最近评论</h4>
  <ul class="recent-comment">
    {% get_recent_comments as comments %}
    {% for comment in comments %}
      <li class="item">
        <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">
          <img src="{{ comment.email|gravatar_url:50 }}" alt="{{ comment.nickname }}" class="avatar">
        </a>
        <div class="con">
          <a href="{{ article.get_absolute_url }}" title="{{ article.title }}">
            <p>{{ comment.content }}</p>
          </a>
          <p class="info">{{ comment.nickname }} 评论于: {{ comment.created_time|date:'Y-m-d' }}</p>
        </div>
      </li>

    {% endfor %}
  </ul>
</div>
<div class="aside">
  <h4 class="title">所有标签</h4>
  <ul class="tags">
    {% for tag in tags %}
      <li>
        <a href="{% url 'blog:tag' tag.slug %}">
          {{ tag.name }}
        </a>
      </li>
    {% endfor %}
  </ul>
</div>

<div class="aside">
  <h4 class="title">站点信息</h4>
  <ul class="site">
    <li>分类:{{ total.category_nums }}个</li>
    <li>标签:{{ total.tag_nums }}个</li>
    <li>文章:{{ total.article_nums }}个</li>
    <li>评论:{{ total.comment_nums }}条</li>
    <li>访问量:{{ total.visit_nums }}条</li>
  </ul>
</div>